home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir24
/
jnos110g.zip
/
UNLINK.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-04-17
|
630b
|
30 lines
#include <stdio.h>
#include <string.h>
#define BUFLEN 128
void main(int argc,char *argv[]) {
char *cp,*cp2;
FILE *fp;
char buf[BUFLEN+1];
if(argc == 1) {
puts("Syntax: Unlink <list-file>");
return;
}
if((fp = fopen(argv[1],"r")) == NULL) {
printf("Could not open %s\n",argv[1]);
return;
}
while(fgets(buf,BUFLEN,fp) != NULL) {
cp = strchr(buf,' ');
cp++;
cp2 = strchr(cp,'.');
strcpy(++cp2,"obj");
if(unlink(cp))
printf("Could not delete %s\n",cp);
}
fclose(fp);
}